<html>
  <head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <title>ssrand</title>
  </head>
  <body bgcolor="#FFFFFF">
    <center>Scilab Function</center>
    <div align="right">Last update : April 1993</div>
    <p>
      <b>ssrand</b> -  random system generator</p>
    <h3>
      <font color="blue">Calling Sequence</font>
    </h3>
    <dl>
      <dd>
        <tt>sl=ssrand(nout,nin,nstate)  </tt>
      </dd>
      <dd>
        <tt>[sl,U]=ssrand(nout,nin,nstate,flag)  </tt>
      </dd>
    </dl>
    <h3>
      <font color="blue">Parameters</font>
    </h3>
    <ul>
      <li>
        <tt>
          <b>nout</b>
        </tt>: integer (number of output)</li>
      <li>
        <tt>
          <b>nin</b>
        </tt>: integer (number of input)</li>
      <li>
        <tt>
          <b>nstate</b>
        </tt>: integer (dimension of state-space)</li>
      <li>
        <tt>
          <b>flag</b>
        </tt>: list made of one character string and one or several integers</li>
      <li>
        <tt>
          <b>sl</b>
        </tt>: list (<tt>
          <b>syslin</b>
        </tt> list)</li>
      <li>
        <tt>
          <b>U</b>
        </tt>square <tt>
          <b>(nstate x nstate)</b>
        </tt> nonsingular matrix</li>
    </ul>
    <h3>
      <font color="blue">Description</font>
    </h3>
    <p>
      <tt>
        <b>sl=ssrand(nout,nin,nstate)</b>
      </tt> returns a random strictly proper 
    (<tt>
        <b>D=0</b>
      </tt>) state-space system of size <tt>
        <b>[nout,nint]</b>
      </tt> represented 
    by a <tt>
        <b>syslin</b>
      </tt> list and with <tt>
        <b>nstate</b>
      </tt> state variables.</p>
    <p>
      <tt>
        <b>[sl,U]=ssrand(nout,nin,nstate,flag)</b>
      </tt> returns a test linear system
    with given properties specified by <tt>
        <b>flag</b>
      </tt>.
    <tt>
        <b>flag</b>
      </tt> can be one of the following:</p>
    <pre>

flag=list('co',dim_cont_subs)  
flag=list('uo',dim_unobs_subs)
flag=list('ncno',dim_cno,dim_ncno,dim_co,dim_nco)
flag=list('st',dim_cont_subs,dim_stab_subs,dim_stab0)  
flag=list('dt',dim_inst_unob,dim_instb0,dim_unobs)
flag=list('on',nr,ng,ng0,nv,rk)
flag=list('ui',nw,nwu,nwui,nwuis,rk)
   
    </pre>
    <p>
    The complete description of the <tt>
        <b>Sys</b>
      </tt> is given in the code
    of the <tt>
        <b>ssrand</b>
      </tt> function (in <tt>
        <b>SCIDIR/macros/util</b>
      </tt>).
    For example with <tt>
        <b>flag=list('co',dim_cont_subs)</b>
      </tt> a non-controllable
    system is return and <tt>
        <b>dim_cont_subs</b>
      </tt> is the dimension
    of the controllable subspace of <tt>
        <b>Sys</b>
      </tt>.
    The character strings <tt>
        <b>'co','uo','ncno','st','dt','on','ui'</b>
      </tt>
    stand for "controllable", "unobservable", "non-controllable-non-observable",
    "stabilizable","detectable","output-nulling","unknown-input".</p>
    <h3>
      <font color="blue">Examples</font>
    </h3>
    <pre>

//flag=list('st',dim_cont_subs,dim_stab_subs,dim_stab0)  
//dim_cont_subs&lt;=dim_stab_subs&lt;=dim_stab0  
//pair (A,B) U-similar to:
//    [*,*,*,*;     [*;    
//    [0,s,*,*;     [0;
//A=  [0,0,i,*;   B=[0;
//    [0,0,0,u]     [0]
//     
// (A11,B1) controllable  s=stable matrix i=neutral matrix u=unstable matrix
[Sl,U]=ssrand(2,3,8,list('st',2,5,5));
w=ss2ss(Sl,inv(U)); //undo the random change of basis =&gt; form as above
[n,nc,u,sl]=st_ility(Sl);n,nc
 
  </pre>
    <h3>
      <font color="blue">See Also</font>
    </h3>
    <p>
      <a href="syslin.htm">
        <tt>
          <b>syslin</b>
        </tt>
      </a>,&nbsp;&nbsp;</p>
  </body>
</html>
